import { ParamStatusCircle } from "@/components/devCard/paramsCard";
import { View } from "@tarojs/components";
const ParamRaw: React.FC<{
  paramName?: string;
  paramValue?: string;
  paramStatus?: string;
  paramUnit?: string;
  time?: string;
  onClick?: Function;
}> = ({
  paramName,
  paramStatus,
  paramUnit,
  paramValue,
  time,
  onClick,
}): JSX.Element => {
  return (
    <View
      className="h-68 mb-10 bg-white overflow-hidden"
      onClick={() => onClick && onClick()}
    >
      {/* 参数状态、名称和时间 */}
      <View className="mt-11 mb-6 h-20 flex justify-between items-center pl-24 pr-16">
        <View className="flex justify-center items-center">
          <View className="mr-8">
            <ParamStatusCircle status={paramStatus}></ParamStatusCircle>
          </View>
          <View className="min-w-26 text-14 font-normal">{paramName}</View>
        </View>
        <View className="w-116 h-13 text-11 text-xxx_text">{time}</View>
      </View>
      {/* 参数数值和状态内容 */}
      <View className="h-20 flex justify-start items-center pl-24 pr-16">
        <View className="h-20 mr-6 flex items-center">
          <View className="notHanzi mr-6 text-14 text-xx_text">
            {paramValue || "--"}
          </View>
          <View className="notHanzi text-12 text-xx_text">{paramUnit}</View>
        </View>
        <View className="h-20 text-14 ml-24 font-normal text-info_text text-right">
          {paramStatus}
        </View>
      </View>
    </View>
  );
};
export default ParamRaw;
